var http = require('http');

http.createServer(onRequest).listen(8888);
console.log('Server running ,port at 8888');
// 终端打印如下信息

function onRequest(req,resp){
	console.log('客户端请求进来');
	http.get('http://asay.pub/info', function (response) {
		console.log('连接到外网:'+response.statusCode);
		var cont = ""
		response.on('data', function (chunk) {
			cont += chunk.toString();
			console.log('on data')
		});
		response.on('end', function () {
			console.log('关闭外网连接');
			console.log(cont);
			resp.write(cont);
			resp.end();
		});

	});


}


